package org.springblade.modules.repair.mapper;
import cn.hutool.core.date.DateTime;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.repair.dto.statistical.DayWorkDetailDTO;
import org.springblade.modules.repair.dto.statistical.WorkCalendarDTO;
import org.springblade.modules.repair.vo.MaintainPlanUserDayCountVO;
import org.springblade.modules.repair.vo.statistics.*;

import java.util.Date;
import java.util.List;

public interface WorkStatisticalMapper {

	List<WorkCalendarVO> selectWorkCalendar(@Param("params") WorkCalendarDTO params, @Param("rangeDate") List<DateTime> rangeDate);

	List<WorkOrderListVO> selectWorkOrderList(@Param("params") WorkCalendarDTO params);

	/**
	 * 查询当天工作日历
	 * @param userIds
	 * @return
	 */
	WorkCalendarVO selectTodayWorkCalendar(@Param("userIds") List<Long> userIds);

	/**
	 * 查询今天以前未处理保养工单数
	 * @param userIds
	 * @return
	 */
	long selectTodayPlanCount(@Param("userIds") List<Long> userIds);

	/**
	 * 个人某天作业详情
	 * @param params
	 * @return
	 */
	List<DayWorkDetailVO> personalWorkDetail(@Param("params") DayWorkDetailDTO params);

	/**
	 * 个人今天作业详情
	 * @param params
	 * @return
	 */
	List<DayWorkDetailVO> personalTodayWorkDetail(@Param("params") DayWorkDetailDTO params);

	/**
	 * 各类型工单作业明细
	 * @param userIds
	 * @param date
	 * @param deptId
	 * @return
	 */
	List<WorkTypeDetailVO> workTypeDetail(@Param("userIds") List<Long> userIds, @Param("deptId") Long deptId, @Param("date") Date date);

	/**
	 * 今日各类型工单作业明细
	 * @param userIds
	 * @return
	 */
	List<WorkTypeDetailVO> todayWorkTypeDetail(@Param("userIds") List<Long> userIds);

	/**
	 * 查询作业数据
	 * @param beginDate
	 * @param endDate
	 * @param userIds
	 * @param type 1: 保养, 2: 维修, 3: 困人, 4: 部件更换
	 * @return
	 */
	List<MaintainPlanUserDayCountVO> selectWorkDayList(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("userIds") List<Long> userIds, @Param("type") Integer type);

	List<WorkCalendarTaskCountVO> selectWorkCalendarTaskCount(@Param("userIds") List<Long> userIds, @Param("start") Date start, @Param("end") Date end);
}
